<!-- 特定主题页面：主题名称和条目内容-->

{% extends "learning_logs/base.html" %}

{% block page_header %}
  <h3>{{ topic }}</h3>
{% endblock page_header %}

<!-- 开始定义块content-->
{% block content %}

<p>Topics:{{ topic }}</p>

<p>Entries:</p>
<p>
  <!-- 添加条目：链接到对应的页面 -->
  <a href="{% url 'learning_logs:new_entry' topic.id %}">Add new entry</a>
</p>

<ul>
{% for entry in entries %}
  <div class="card mb-3">
    <h4 class="card-header-3">
      {{ entry.date_added|date:'M d, Y H:i' }} <!--时间戳-->
      <small><a href="{% url 'learning_logs:edit_entry' entry.id %}">
        Edit entry</a></small>
    </h4>
    <div class="card-body">
      <p>{{ entry.text|linebreaks }}</p>  <!--文本-->
    </div>
  </div>
{% empty %}
  <p>There are no entries for this topic yet.</p>
{% endfor %}
</u>

{% endblock content %}